home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earcd / grafica / ghostscript / amiga-gs510 / gs5.03 / gs.mak.in < prev    next >
Text File  |  1997-11-25  |  15KB  |  340 lines

  1. #    Copyright (C) 1989, 1996, 1997 Aladdin Enterprises.  All rights reserved.
  2. # This file is part of Aladdin Ghostscript.
  3. # Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  4. # or distributor accepts any responsibility for the consequences of using it,
  5. # or for whether it serves any particular purpose or works at all, unless he
  6. # or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  7. # License (the "License") for full details.
  8. # Every copy of Aladdin Ghostscript must include a copy of the License,
  9. # normally in a plain ASCII text file named PUBLIC.  The License grants you
  10. # the right to copy, modify and redistribute Aladdin Ghostscript, but only
  11. # under certain conditions described in the License.  Among other things, the
  12. # License requires that the copyright notice and this notice be preserved on
  13. # all copies.
  14.  
  15. # Generic makefile, common to all platforms.
  16. # The platform-specific makefiles `include' this file.
  17. # They define the following symbols:
  18. #    GS - the name of the executable (without the extension, if any).
  19. #    GS_LIB_DEFAULT - the default directory/ies for searching for the
  20. #        initialization and font files at run time.
  21. #    SEARCH_HERE_FIRST - the default setting of -P (whether or not to
  22. #        look for files in the current directory first).
  23. #    GS_DOCDIR - the directory where documentation will be available
  24. #        at run time.
  25. #    JSRCDIR - the directory where the IJG JPEG library source code
  26. #        is stored (at compilation time).
  27. #    JVERSION - the major version number of the IJG JPEG library.
  28. #    PSRCDIR, PVERSION - the same for libpng.
  29. #    ZSRCDIR - the same for zlib.
  30. #    SHARE_LIBPNG - normally 0; if set to 1, asks the linker to use
  31. #        an existing compiled libpng (-lpng) instead of compiling and
  32. #        linking libpng explicitly.
  33. #    LIBPNG_NAME, the name of the shared libpng, currently always
  34. #        png (libpng, -lpng).
  35. #    SHARE_ZLIB - normally 0; if set to 1, asks the linker to use
  36. #        an existing compiled zlib (-lgz or -lz) instead of compiling
  37. #        and linking libgz/libz explicitly.
  38. #    ZLIB_NAME - the name of the shared zlib, either gz (for libgz, -lgz)
  39. #        or z (for libz, -lz).
  40. #    CONFIG - a configuration ID, added at the request of a customer,
  41. #        that is supposed to help in maintaining multiple variants in
  42. #        a single directory.  Normally this is an empty string;
  43. #        it may be any string that is legal as part of a file name.
  44. #    DEVICE_DEVS - the devices to include in the executable.
  45. #        See devs.mak for details.
  46. #    DEVICE_DEVS1...DEVICE_DEVS15 - additional devices, if the definition
  47. #        of DEVICE_DEVS doesn't fit on one line.  See devs.mak for details.
  48. #    FEATURE_DEVS - what features to include in the executable.
  49. #        Normally this is one of:
  50. #            level1 - a standard PostScript Level 1 language
  51. #            interpreter.
  52. #            level2 - a standard PostScript Level 2 language
  53. #            interpreter.
  54. #            pdf - a PDF-capable interpreter.
  55. #        You may include both level1 and pdf, or both level2 and pdf.
  56. #        The following feature may be added to either of the standard
  57. #        configurations:
  58. #            ccfonts - precompile fonts into C, and link them
  59. #            with the executable.  See fonts.txt for details.
  60. #        The remaining features are of interest primarily to developers
  61. #        who want to "mix and match" features to create custom
  62. #        configurations:
  63. #            dps - (partial) support for Display PostScript extensions:
  64. #            see language.txt for details.
  65. #            btoken - support for binary token encodings.
  66. #            Included automatically in the dps and level2 features.
  67. #            cidfont - (currently partial) support for CID-keyed fonts.
  68. #            color - support for the Level 1 CMYK color extensions.
  69. #            Included automatically in the dps and level2 features.
  70. #            compfont - support for composite (type 0) fonts.
  71. #            Included automatically in the level2 feature.
  72. #            dct - support for DCTEncode/Decode filters.
  73. #            Included automatically in the level2 feature.
  74. #            epsf - support for recognizing and skipping the binary
  75. #            header of MS-DOS EPSF files.
  76. #            filter - support for Level 2 filters (other than eexec,
  77. #            ASCIIHexEncode/Decode, NullEncode, PFBDecode,
  78. #            RunLengthEncode/Decode, and SubFileDecode, which are
  79. #            always included, and DCTEncode/Decode,
  80. #            which are separate).
  81. #            Included automatically in the level2 feature.
  82. #            fzlib - support for zlibEncode/Decode filters.
  83. #            ttfont - support for TrueType fonts.
  84. #            type1 - support for Type 1 fonts and eexec;
  85. #            normally included automatically in all configurations.
  86. #            type42 - support for Type 42 (embedded TrueType) fonts.
  87. #            Included automatically in the level2 feature.
  88. #        There are quite a number of other sub-features that can be
  89. #        selectively included in or excluded from a configuration,
  90. #        but the above are the ones that are most likely to be of
  91. #        interest.
  92. #    COMPILE_INITS - normally 0; if set to 1, compiles the PostScript
  93. #        language initialization files (gs_init.ps et al) into the
  94. #        executable, eliminating the need for these files to be present
  95. #        at run time.
  96. #    BAND_LIST_STORAGE - normally file; if set to memory, stores band
  97. #        lists in memory (with compression if needed).
  98. #    BAND_LIST_COMPRESSOR - normally zlib: selects the compression method
  99. #        to use for band lists in memory.
  100. #    FILE_IMPLEMENTATION - normally stdio; if set to fd, uses file
  101. #        descriptors instead of buffered stdio for file I/O; if set to
  102. #        both, provides both implementations with different procedure
  103. #        names for the fd-based implementation (see sfxfd.c for
  104. #        more information).
  105. #    EXTEND_NAMES - a value N between 0 and 6, indicating that the name
  106. #        table should have a capacity of 2^(16+N) names.  This normally
  107. #        should be set to 0 (or left undefined), since non-zero values
  108. #        result in a larger fixed space overhead and slightly slower code.
  109. #        EXTEND_NAMES is ignored in 16-bit environments.
  110. #
  111. # It is very unlikely that anyone would want to edit the remaining
  112. #   symbols, but we describe them here for completeness:
  113. #    GS_INIT - the name of the initialization file for the interpreter,
  114. #        normally gs_init.ps.
  115. #    PLATFORM - a "device" name for the platform, so that platforms can
  116. #        add various kinds of resources like devices and features.
  117. #    CMD - the suffix for shell command files (e.g., null or .bat).
  118. #        (This is only needed in a few places.)
  119. #    D - the directory separator character (\ for MS-DOS, / for Unix).
  120. #    O - the string for specifying the output file from the C compiler
  121. #        (-o for MS-DOS, -o ./ for Unix).
  122. #    OBJ - the extension for relocatable object files (e.g., o or obj).
  123. #    XE - the extension for executable files (e.g., null or .exe).
  124. #    XEAUX - the extension for the executable files (e.g., null or .exe)
  125. #        for the utility programs (ansi2knr and those compiled with
  126. #        CCAUX).
  127. #    BEGINFILES - the list of files that `make begin' and `make clean'
  128. #        should delete.
  129. #    CCA2K - the C invocation for the ansi2knr program, which is the only
  130. #        one that doesn't use ANSI C syntax.  (It is only needed if
  131. #        the main C compiler also isn't an ANSI compiler.)
  132. #    CCAUX - the C invocation for auxiliary programs (echogs, genarch,
  133. #        genconf, geninit).
  134. #    CCBEGIN - the compilation command for `make begin', normally
  135. #        $(CCC) *.c.
  136. #    CCC - the C invocation for normal compilation.
  137. #    CCD - the C invocation for files that store into frame buffers or
  138. #        device registers.  Needed because some optimizing compilers
  139. #        will eliminate necessary stores.
  140. #    CCCF - the C invocation for compiled fonts and other large,
  141. #        self-contained data modules.  Needed because MS-DOS
  142. #        requires using the 'huge' memory model for these.
  143. #    CCINT - the C invocation for compiling the main interpreter module,
  144. #        normally the same as CCC: this is needed because the
  145. #        Borland compiler generates *worse* code for this module
  146. #        (but only this module) when optimization (-O) is turned on.
  147. #    CCLEAF - the C invocation for compiling modules that contain only
  148. #        leaf procedures, which don't need to build stack frames.
  149. #        This is needed only because many compilers aren't able to
  150. #        recognize leaf procedures on their own.
  151. #    AK - if source files must be converted from ANSI to K&R syntax,
  152. #        this is $(ANSI2KNR_XE); if not, it is null.
  153. #        If a particular platform requires other utility programs
  154. #        to be built, AK must include them too.
  155. #    SHP - the prefix for invoking a shell script in the current directory
  156. #        (null for MS-DOS, $(SH) ./ for Unix).
  157. #    EXPP, EXP - the prefix for invoking an executable program in the
  158. #        current directory (null for MS-DOS, ./ for Unix).
  159. #    SH - the shell for scripts (null on MS-DOS, sh on Unix).
  160. #    CONFILES - the arguments for genconf to generate the appropriate
  161. #        linker control files (various).
  162. #    CP_ - the command for copying one file to another.  Because of
  163. #        limitations in the MS-DOS/MS Windows environment, the
  164. #        second argument must either be '.' (in which case the
  165. #        write date may be either preserved or set to the current
  166. #        date) or a file name (in which case the write date is
  167. #        always updated).
  168. #    RM_ - the command for deleting (a) file(s) (including wild cards,
  169. #        but limited to a single file or pattern).
  170. #    RMN_ = the command for deleting multiple files / patterns.
  171. #
  172. # The platform-specific makefiles must also include rules for creating
  173. # certain dynamically generated files:
  174. #    gconfig_.h - this indicates the presence or absence of
  175. #        certain system header files that are located in different
  176. #        places on different systems.  (It could be generated by
  177. #        the GNU `configure' program.)
  178. #    gconfigv.h - this indicates the status of certain machine-
  179. #        and configuration-specific features derived from definitions
  180. #        in the platform-specific makefile.
  181.  
  182. # Define the name of this makefile.
  183. GS_MAK=makefile
  184.  
  185. # Define the names of the executables.
  186. GS_XE=$(GS)$(XE)
  187. ANSI2KNR_XE=ansi2knr$(XEAUX)
  188. ECHOGS_XE=echogs$(XEAUX)
  189. GENARCH_XE=genarch$(XEAUX)
  190. GENCONF_XE=genconf$(XEAUX)
  191. GENINIT_XE=geninit$(XEAUX)
  192.  
  193. # Define the names of the CONFIG-dependent header files.
  194. # gconfig*.h and gconfx*.h are generated dynamically.
  195. gconfig_h=gconfxx$(CONFIG).h
  196. gconfigf_h=gconfxc$(CONFIG).h
  197.  
  198. # Watcom make insists that rules have a non-empty body!
  199. all default: $(GS_XE)
  200.     $(RM_) _temp_*
  201.  
  202. distclean maintainer-clean realclean: clean
  203.     $(RM_) makefile
  204.  
  205. clean: mostlyclean
  206.     $(RM_) arch.h
  207.     $(RM_) $(GS_XE)
  208.  
  209. mostlyclean:
  210.     $(RMN_) *.$(OBJ) *.a core gmon.out
  211.     $(RMN_) *.dev *.d_* devs*.tr gconfig*.h gconfx*.h j*.h o*.tr l*.tr
  212.     $(RMN_) deflate.h zutil.h
  213.     $(RMN_) gconfig*.c gscdefs*.c iconfig*.c
  214.     $(RMN_) _temp_* _temp_*.* *.map *.sym
  215.     $(RMN_) $(ANSI2KNR_XE) $(ECHOGS_XE) $(GENARCH_XE) $(GENCONF_XE) $(GENINIT_XE)
  216.     $(RMN_) gs_init.c $(BEGINFILES)
  217.  
  218. # Remove only configuration-dependent information.
  219. config-clean:
  220.     $(RMN_) *.dev devs*.tr gconfig*.h gconfx*.h o*.tr l*.tr
  221.  
  222. # A rule to do a quick and dirty compilation attempt when first installing
  223. # the interpreter.  Many of the compilations will fail:
  224. # follow this with 'make'.
  225.  
  226. begin:
  227.     $(RMN_) arch.h gconfig*.h gconfx*.h $(GENARCH_XE) $(GS_XE)
  228.     $(RMN_) gconfig*.c gscdefs*.c iconfig*.c
  229.     $(RMN_) gs_init.c $(BEGINFILES)
  230.     make arch.h gconfigv.h
  231.     - $(CCBEGIN)
  232.     $(RMN_) gconfig.$(OBJ) gdev*.$(OBJ) gp_*.$(OBJ) gscdefs.$(OBJ) gsmisc.$(OBJ)
  233.     $(RMN_) ccfontab.$(OBJ) iconfig.$(OBJ) iinit.$(OBJ) interp.$(OBJ)
  234.  
  235. # Auxiliary programs
  236.  
  237. arch.h: $(GENARCH_XE)
  238.     $(EXPP) $(EXP)genarch arch.h
  239.  
  240. # Macros for constructing the *.dev files that describe features and
  241. # devices.
  242. SETDEV=$(EXP)echogs -e .dev -w- -l-dev -F -s -l-obj
  243. SETPDEV=$(EXP)echogs -e .dev -w- -l-dev -F -s -l-include -lpage -l-obj
  244. SETMOD=$(EXP)echogs -e .dev -w- -l-obj
  245. ADDMOD=$(EXP)echogs -e .dev -a-
  246.  
  247. # Define the compilation commands for the third-party libraries.
  248. CCCP=$(CCC) -I$(PSRCDIR) -I$(ZSRCDIR) -DPNG_USE_CONST
  249. CCCJ=$(CCC) -I. -I$(srcdir) -I$(JSRCDIR)
  250. CCCZ=$(CCC) -I. -I$(srcdir) -I$(ZSRCDIR)
  251.  
  252. ######################## How to define new 'features' #######################
  253. #
  254. # One defines new 'features' exactly like devices (see devs.mak for details).
  255. # For example, one would define a feature abc by adding the following to
  256. # gs.mak:
  257. #
  258. #    abc_=abc1.$(OBJ) ...
  259. #    abc.dev: $(GS_MAK) $(ECHOGS_XE) $(abc_)
  260. #        $(SETMOD) abc $(abc_)
  261. #        $(ADDMOD) abc -obj ... [if needed]
  262. #        $(ADDMOD) abc -oper ... [if appropriate]
  263. #        $(ADDMOD) abc -ps ... [if appropriate]
  264. #
  265. # If the abc feature requires the presence of some other features jkl and
  266. # pqr, then the rules must look like this:
  267. #
  268. #    abc_=abc1.$(OBJ) ...
  269. #    abc.dev: $(GS_MAK) $(ECHOGS_XE) $(abc_) jkl.dev pqr.dev
  270. #        $(SETMOD) abc $(abc_)
  271. #        ...
  272. #        $(ADDMOD) abc -include jkl pqr
  273.  
  274. # --------------------- Configuration-dependent files --------------------- #
  275.  
  276. # gconfig.h shouldn't have to depend on DEVS_ALL, but that would
  277. # involve rewriting gsconfig to only save the device name, not the
  278. # contents of the <device>.dev files.
  279. # FEATURE_DEVS must precede DEVICE_DEVS so that devices can override
  280. # features in obscure cases.
  281.  
  282. DEVS_ALL=$(PLATFORM).dev $(FEATURE_DEVS) \
  283.   $(DEVICE_DEVS) $(DEVICE_DEVS1) \
  284.   $(DEVICE_DEVS2) $(DEVICE_DEVS3) $(DEVICE_DEVS4) $(DEVICE_DEVS5) \
  285.   $(DEVICE_DEVS6) $(DEVICE_DEVS7) $(DEVICE_DEVS8) $(DEVICE_DEVS9) \
  286.   $(DEVICE_DEVS10) $(DEVICE_DEVS11) $(DEVICE_DEVS12) $(DEVICE_DEVS13) \
  287.   $(DEVICE_DEVS14) $(DEVICE_DEVS15)
  288.  
  289. devs_tr=devs.tr$(CONFIG)
  290. $(devs_tr): $(GS_MAK) $(MAKEFILE) $(ECHOGS_XE)
  291.     $(EXP)echogs -w $(devs_tr) - -include $(PLATFORM).dev
  292.     $(EXP)echogs -a $(devs_tr) - $(FEATURE_DEVS)
  293.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS)
  294.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS1)
  295.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS2)
  296.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS3)
  297.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS4)
  298.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS5)
  299.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS6)
  300.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS7)
  301.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS8)
  302.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS9)
  303.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS10)
  304.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS11)
  305.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS12)
  306.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS13)
  307.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS14)
  308.     $(EXP)echogs -a $(devs_tr) - $(DEVICE_DEVS15)
  309.  
  310. # GCONFIG_EXTRAS can be set on the command line.
  311. # Note that it consists of arguments for echogs, i.e.,
  312. # it isn't just literal text.
  313. GCONFIG_EXTRAS=
  314.  
  315. ld_tr=ld$(CONFIG).tr
  316. $(gconfig_h) $(ld_tr) lib.tr: \
  317.   $(GS_MAK) $(MAKEFILE) version.mak $(GENCONF_XE) $(ECHOGS_XE) $(devs_tr) $(DEVS_ALL) libcore.dev
  318.     $(EXP)genconf $(devs_tr) libcore.dev -h $(gconfig_h) $(CONFILES)
  319.     $(EXP)echogs -a $(gconfig_h) -x 23 define -s -u GS_LIB_DEFAULT -x 2022 $(GS_LIB_DEFAULT) -x 22
  320.     $(EXP)echogs -a $(gconfig_h) -x 23 define -s -u SEARCH_HERE_FIRST -s $(SEARCH_HERE_FIRST)
  321.     $(EXP)echogs -a $(gconfig_h) -x 23 define -s -u GS_DOCDIR -x 2022 $(GS_DOCDIR) -x 22
  322.     $(EXP)echogs -a $(gconfig_h) -x 23 define -s -u GS_INIT -x 2022 $(GS_INIT) -x 22
  323.     $(EXP)echogs -a $(gconfig_h) -x 23 define -s -u GS_REVISION -s $(GS_REVISION)
  324.     $(EXP)echogs -a $(gconfig_h) -x 23 define -s -u GS_REVISIONDATE -s $(GS_REVISIONDATE)
  325.     $(EXP)echogs -a $(gconfig_h) $(GCONFIG_EXTRAS)
  326.  
  327. ################################################################
  328. # The other platform-independent makefiles are concatenated
  329. # (or included) after this one:
  330. #    lib.mak
  331. #    int.mak
  332. #    jpeg.mak
  333. #    libpng.mak
  334. #    zlib.mak
  335. #    devs.mak
  336. ################################################################
  337.